package com.example.miaosha.vo.base;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 分页对象
 *
 * @Author
 * @Date 2022/1/17 13:39
 */
@Data
public abstract class LimitVo<T> {
    /**
     * 当前页数
     */
    @ApiModelProperty(value = "当前页数")
    private Integer pageNum = 1;

    /**
     * 显示条数
     */
    @ApiModelProperty(value = "显示条数")
    private Integer pageSize = 10;


    @ApiModelProperty(hidden = true)
    public IPage<T> getPage() {
        return new Page<T>().setCurrent(this.pageNum).setSize(this.pageSize);
    }
}
